version = '0.21.3'

local home = os.getenv("HOME")
local xpm_path = home .. "/.local/share/xplr/dtomvan/xpm.xplr"
local xpm_url = "https://github.com/dtomvan/xpm.xplr"


package.path = package.path .. ";" .. xpm_path .. "/?.lua;" .. xpm_path .. "/?/init.lua"

os.execute(string.format("[ -e '%s' ] || git clone '%s' '%s'", xpm_path, xpm_url, xpm_path))


require("xpm").setup({

	-- This works
	"dtomvan/xpm.xplr",
  'sayanarijit/map.xplr',
  'gitlab:hartan/web-devicons.xplr',
  'sayanarijit/zentable.xplr',
  {
    name = 'dtomvan/term.xplr',
    setup = function ()
      local term = require('term')
      local tv = term.profile_tmux_vsplit()
      local th = term.profile_tmux_hsplit()
      tv.key = 'ctrl-v'
      th.key = 'ctrl-h'
      term.setup({tv, th})
    end
  },
	{
		"dtomvan/extra-icons.xplr",
		after = function()
			xplr.config.general.table.row.cols[2] = { format = "custom.icons_dtomvan_col_1" }
		end,
	},
})

-- local plugin

package.path = home
  .. "/.config/xplr/plugins/?/init.lua;"
  .. home
  .. "/.config/xplr/plugins/?.lua;"
  .. package.path

require('zlua').setup()
